//
//  HMHomeTitleButton.swift
//  WymanWeibo
//
//  Created by wyman on 16/4/12.
//  Copyright © 2016年 wyman. All rights reserved.
//

import UIKit

class HMHomeTitleButton: UIButton {

   
    init(title: String){
    super.init(frame: CGRectZero)
        self .setTitle(title, forState: .Normal)
        self.setTitleColor(UIColor.orangeColor(), forState: UIControlState.Normal)
        
        self.setImage(UIImage(named: "navigationbar_arrow_down"), forState: .Normal)
        
        self.sizeToFit()
    
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        titleLabel?.frame.origin.x = 0
        
        imageView?.frame.origin.x = titleLabel!.frame.width + 3
    }

}
